package com.dgut.legalservice.service.impl;

import com.dgut.legalservice.dao.ICompanyDao;
import com.dgut.legalservice.dao.IOrderDao;
import com.dgut.legalservice.domain.Company;
import com.dgut.legalservice.service.CompanyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CompanyServiceImpl implements CompanyService {

    @Autowired
    private ICompanyDao companyDao;
    @Autowired
    private IOrderDao orderDao;

    @Override
    public int addComponyName(Company company, String id) {
        int companyId = companyDao.addComponyName(company);
        int i = orderDao.addOrderRer1(Integer.parseInt(id), company.getId());
        //System.out.println("公司的id是:"+company.getId());

        return i;
    }

    @Override
    public int addComponyCreat(Company company, String id) {
        int companyId = companyDao.addComponyCreat(company);
        int i = orderDao.addOrderRer1(Integer.parseInt(id), company.getId());

        return i;
    }

    @Override
    public int addComponySeal(Company company, String id) {
        int companyId = companyDao.addComponySeal(company);
        int i = orderDao.addOrderRer1(Integer.parseInt(id), company.getId());

        return i;
    }

    @Override
    public int addComponyBank(Company company, String id) {
        int companyId = companyDao.addComponyBank(company);
        int i = orderDao.addOrderRer1(Integer.parseInt(id), company.getId());

        return i;
    }
}
